//
//  BKOrderBRView.m
//  bestkeep
//
//  Created by yons on 17/1/19.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BKOrderBRView.h"
#import "BK_OD_Color.h"
#import "BK_OD_Tool.h"
@implementation BKOrderBRView

@end


@implementation BKOrderBRFooterView
{
    UIButton *_submitBtn;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initialize];
    }
    return self;
}

- (void)initialize
{
    self.backgroundColor = [UIColor clearColor];
    
    _submitBtn = [[UIButton alloc] init];
    [_submitBtn setTitleColor:kOrderWhite forState:UIControlStateNormal];
    _submitBtn.titleLabel.font = UIFontLargest;
    [_submitBtn setTitle:kOrderLocalizeString(@"BKOrderRechargeConfirmation") forState:UIControlStateNormal];
    UIImage *bgimage = [Common imageWithFrame:CGRectMake(0, 0, 1, 1) color:kOrderBKGreen];
    [_submitBtn setBackgroundImage:bgimage forState:UIControlStateNormal];
    _submitBtn.layer.cornerRadius = 3;
    _submitBtn.layer.masksToBounds = YES;
    [_submitBtn addTarget:self action:@selector(submitAction:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_submitBtn];
    
    [_submitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsMake(0, 15, 0, 15));
    }];
}

- (void)submitAction:(UIButton *)sender
{
    if (self.delegate && [self.delegate conformsToProtocol:@protocol(BKOrderBRFooterViewDelegate)]) {
        [self.delegate orderBRFooterViewDidSubmit];
    }
}

@end
